<?php

namespace App\Admin\Controllers\Partner;

use App\Models\Partner\Partner;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Show;
use Dcat\Admin\Controllers\AdminController;


class PartnerController extends AdminController
{


    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        return Grid::make(new Partner, function (Grid $grid) {
            $grid->id->sortable();
            $grid->name();
            $grid->column('power_rate');
            $grid->column('profit');
            $grid->created_at();
            $grid->disableCreateButton();
            $grid->disableDeleteButton();
            $grid->disableBatchDelete();
            $grid->disableViewButton();

        });
    }



    /**
     * Make a form builder.
     *
     * @return Form
     */
    protected function form()
    {
        return Form::make(new Partner(), function (Form $form) {
            $form->text('name');
            $form->text('power_rate');
            $form->text('profit');
            $form->footer(function ($footer){
                $footer->disableEditingCheck();
                $footer->disableViewCheck();
            });
            $form->disableViewButton();
            $form->disableDeleteButton();
        });
    }
}
